<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>closure</title>
</head>
<body>
  <script>
    // getSalary(12000, 2000)
    // getSalary(15000, 3000)
    // getSalary(15000, 4000)
    // function makeSalary(level) {
    //   return function(perm) {
    //     return level + perm
    //   }
    // }
    // let salaryOne = makeSalary(12000)
    // let salaryTwo = makeSalary(15000)
 
    // console.log(salaryOne(2000))
    // console.log(salaryTwo(3000))
    // console.log(salaryTwo(4000))

function a() {
  let count = 1
  return function() {
    return count += 1
  }
}
console.log(a())
  </script>
</body>
</html>